package com.eling.elcms.travel.model;

import com.eling.elcms.core.dao.annotation.In;
import com.eling.elcms.core.model.BaseModel;
import com.eling.elcms.system.model.CommonUser;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.IndexedEmbedded;

import javax.persistence.*;
import java.util.Date;

/**
 * 报名收费
 * @author zhoulin
 * 
 * 模型评审：新增模型，wulina 2016-09-07
 */
@Entity
@Indexed
@Table(name = "travel_signupcharge")
public class SignUpCharge extends BaseModel {

	private static final long serialVersionUID = -4865137998739770773L;

	@Id
	@In
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@DocumentId
	private Long pkSignUpCharge;

	/** 报名登记 */
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkSignUpRegister")
	@IndexedEmbedded(depth = 1)
	private SignUpRegister signUpRegister;

	/** 预收款 */
	@Column
	@Field
	private Double payable;

	/** 收费人 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pkOperator")
	@IndexedEmbedded(depth = 1)
	private CommonUser operator;

	/** 收费日期 */
	@Column
	@Field
	private Date chargeDate;
	
	@Version
	private Integer version;
	
	public Long getPkSignUpCharge() {
		return pkSignUpCharge;
	}

	public void setPkSignUpCharge(Long pkSignUpCharge) {
		this.pkSignUpCharge = pkSignUpCharge;
	}

	public SignUpRegister getSignUpRegister() {
		return signUpRegister;
	}

	public void setSignUpRegister(SignUpRegister signUpRegister) {
		this.signUpRegister = signUpRegister;
	}

	public Double getPayable() {
		return payable;
	}

	public void setPayable(Double payable) {
		this.payable = payable;
	}

	public CommonUser getOperator() {
		return operator;
	}

	public void setOperator(CommonUser operator) {
		this.operator = operator;
	}

	public Date getChargeDate() {
		return chargeDate;
	}

	public void setChargeDate(Date chargeDate) {
		this.chargeDate = chargeDate;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

}
